const dao= require('../../dao/daoenter.js');
const model  = require('../../dao/model/model');
const result= require('../../util/result/result.js');



/* 用户添加  定位职业 */
async function locationProfessionadd(req,res){
    /* 
    前端参数：
    userid
    professionTypeid
    profunctionid
    industryid
    professionid
    */

    let obj=new dao.locationProfessiondao(model.modellocationProfession)
    let aa 
    try {
       aa= await obj.add(req.body)
    } catch (error) {
        console.log(error)
        return
    }

    if(aa){
       res.send(result.result(true))
    }else {
       res.send(result.result(false))
    }
}


/* 查询指定用户职业信息 */
async function queryUserProfession(req,res){

    /*
    前端参数
    userid
    */
    /* 创建model对象 */
 
    let obj=new dao.locationProfessiondao(model.modellocationProfession)
    let bb=await obj.queryUserProfession(req.body.userid)
    if(bb){
        res.send(result.result(true,bb))
    }else {
        res.send(result.result(false))
    }
}












module.exports={
    locationProfessionadd,queryUserProfession


}